home *** CD-ROM | disk | FTP | other *** search
- Path: news.sunquest.com!kitk!kitk
- From: kitk@mudshark.sunquest.com (Kit Kauffmann)
- Newsgroups: comp.lang.c++
- Subject: Re: How to prototype a class?
- Date: Thu, 15 Feb 1996 15:56:58
- Organization: Sunquest
- Message-ID: <kitk.2095.000FF385@mudshark.sunquest.com>
- References: <4fvjhe$c6o@nuntius.u-net.net> <DMtxzu.8HK@tr.unisys.com>
- NNTP-Posting-Host: kkauffma.sunquest.com
- X-Newsreader: Trumpet for Windows [Version 1.0 Rev A]
-
- In article <DMtxzu.8HK@tr.unisys.com> "Benjamin M. Romer" <bmr1@trpo4.tr.unisys.com> writes:
-
- >Use a forward declaration:
-
- >class A; //I promise to define A later.
-
- >class B
- >{
- > ...
- >private:
- > A dataMember;
- >};
-
- >Class A
- >{
- > ...
- >private:
- > B dataMember;
- >};
-
- >Hope this helps.
-
- >Benjamin M. Romer
- >Software Engineer
- >Unisys Corporation
-
- >#include <stddisclaim.h>
-
- This won't work: the compiler has to know the size of an attribute, which
- doesn't happen w/ a forward declare. You can declare pointers to objects of
- unknown size, but not objects themselves.
-
-
- Kit Kauffmann - kitk@mudshark.sunquest.com
- AKA 73363,447 (Compu$erve)
-
- Finger me for my public key
-